package com.ketangpai.admin.utils;

import java.util.Random;

public class CourseCodeGenerator {

    private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

    public static String generateCourseCode() {
        Random random = new Random();
        StringBuilder courseCode = new StringBuilder();

        for (int i = 0; i < 6; i++) {
            int index = random.nextInt(CHARACTERS.length());
            courseCode.append(CHARACTERS.charAt(index));
        }

        return courseCode.toString();
    }

}
